package com.module.sysconfig.service.impl;

import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.module.sysconfig.dao.BdzhbMapper;
import com.module.sysconfig.entity.Bdzhb;
import com.module.sysconfig.service.BdzhbService;
import com.support.cache.annotation.CacheEvict;
import com.support.cache.annotation.Cacheable;
import com.support.cache.annotation.KeyMode;

@Service
public class BdzhbServiceImpl implements BdzhbService
{

	private BdzhbMapper bdzhbMapper;
	
	@Autowired
	public void setBdzhbMapper(BdzhbMapper bdzhbMapper) 
	{
		this.bdzhbMapper = bdzhbMapper;
	}
	
	/**
	 * 新增系统表单组合表数据
	 */
	@CacheEvict(key="ALL_BDZHB_RECORD")
	public void saveBdzhb(Bdzhb bdzhb)
	{
		bdzhbMapper.saveBdzhb(bdzhb);
	}

	/**
	 * 更新系统表单组合表数据
	 */
	@CacheEvict(key="ALL_BDZHB_RECORD")
	public void updateBdzhb(Bdzhb bdzhb) 
	{
		bdzhbMapper.updateBdzhb(bdzhb);
	}

	/**
	 * 删除系统表单组合表数据
	 */
	@CacheEvict(key="ALL_BDZHB_RECORD")
	public void deleteBdzhb(long id) 
	{
		bdzhbMapper.deleteBdzhb(id);
	}
	
	/**
	 * 根据ID查询系统表单组合表数据
	 * @param id
	 * @return
	 */
	public Bdzhb queryBdzhbById(long id)
	{
		return bdzhbMapper.queryBdzhbById(id);
	}
	
	/**
	 * 查询所有系统表单组合表数据
	 * @return
	 */
	@Cacheable(keyMode=KeyMode.KEY_ONLY, key="ALL_BDZHB_RECORD")
	public List<Map<String, Object>> queryBdzhbRecord(){
		return bdzhbMapper.queryBdzhbRecord();
	}
}
